FFI: get scalars from arrays - #8896
Conversation
3945f76 to
c305a0e
Compare
c305a0e to
b1ac575
Compare
Polar Signals Profiling ResultsLatest Run
Previous Runs (1)
Powered by Polar Signals Cloud |
|
Verdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.004x ➖, 0↑ 0↓)
datafusion / parquet (0.901x ➖, 1↑ 0↓)
duckdb / vortex-file-compressed (0.929x ➖, 0↑ 0↓)
duckdb / parquet (0.986x ➖, 0↑ 0↓)
No file size changes detected. |
b1ac575 to
ea86234
Compare
ea86234 to
255042c
Compare
Pull request was converted to draft
|
I've checked again, and I think we want a more gradual change. We do want to be able to get a scalar for an array, but we can't replace current getters with an intermediate vx_scalar:
I've removed the primitive accessors here. |
255042c to
49f87e7
Compare
36789e7 to
11f23f4
Compare
11f23f4 to
413207b
Compare
413207b to
b0ff733
Compare
| * Errors if "index" is out of bounds. | ||
| */ | ||
| const vx_scalar * | ||
| vx_array_get_scalar(const vx_session *session, const vx_array *array, size_t index, vx_error **error_out); |
There was a problem hiding this comment.
This does execution with a session, we should explain that
| pub unsafe extern "C-unwind" fn vx_scalar_new_bool( | ||
| value: bool, | ||
| is_nullable: bool, | ||
| ) -> *mut vx_scalar { | ||
| vx_scalar::new(Scalar::bool(value, Nullability::from(is_nullable))) |
There was a problem hiding this comment.
This seems unneeded, there can only be 3 values here
Can you point to the functions you mean here |
| * std::string_view and BinaryView returned borrow from scalar and stay | ||
| * valid while scalar is valid. | ||
| * | ||
| * Throws if scalar type does not match T or value is Null. |
There was a problem hiding this comment.
we say this method throws here but it does actually panic right? Shall we validate the dtype and validity and throw so we do what we say?
|
|
||
| int64_t vx_array_get_i64(const vx_array *array, size_t index); | ||
|
|
||
| int64_t vx_array_get_storage_i64(const vx_array *array, size_t index); |
There was a problem hiding this comment.
is there an equivalent to do what this method did now?
| } else if constexpr (std::is_same_v<T, double>) { | ||
| return vx_scalar_get_f64(h); | ||
| } else { | ||
| static_assert(false, "f16 scalar get is not supported"); |
There was a problem hiding this comment.
why do we not support f16? I mean we do support constructing f16 arrays or scalars, but we can't get a scalar?
Error propagation in C bindings #7483